<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="../../../mobileHeader_inc.jsp" %>
<title>我要表白</title>
<script type="text/javascript">
function a() {

	
	var fun_ret;
	var vals = $('#b').serialize();
	var url = '/manage/sysConfessionWall/addSave';
	var formData = new FormData($('#b')[0]);
	$.ajax({
		async : false,
		type : "POST",
		url : url,
		data : formData,
		cache : false,
		contentType : false,
		processData : false,
		dataType : 'json',
		xhr : function() { // custom xhr
			myXhr = $.ajaxSettings.xhr();
			if (myXhr.upload) { // if upload property exists
				myXhr.upload.addEventListener('progress',
						progressHandlingFunction, false); // progressbar
			}
			return myXhr;

		},
		//Ajax events
		success : function(data) {
               if(data.success == 0 )
               {
            	   fun_ret = true;
            	   alert("添加成功");
            	   window.location.href = "${ctx }/mobile/goLove";
               }
               else
               {
            	   alert("添加失败");
               }
           },
		error : errorHandler = function(data) {
			alert("添加失败");
			return false;
		}
	});
	return fun_ret;
}

function progressHandlingFunction(e) {
if (e.lengthComputable) {
	$('progress').attr({
		value : e.loaded,
		max : e.total
	});
}
}
</script>
<style type="text/css">
#b{
	margin-left: 5px;
	margin-right: 5px;
}

</style>
</head>
<body>

 <header data-am-widget="header"
          class="am-header am-header-default joan-head">
      <div class="am-header-left am-header-nav">
          <a href="/mobile/goLove" target="_self" class="">
                返回
          </a>
      </div>

      <h2 class="am-header-title">
          我要表白
      </h2>
    
  </header>

 <form id="b" class="am-form" method="post">
  <fieldset>

    <div class="am-form-group">
      <label for="doc-ipt-email-1" style="color: gray">表白对象</label>
      <input type="text" class="" id="name"  name="name" >
    </div>

	<div class="am-form-group">
      <label for="doc-ta-1" style="color: gray">表白内容：</label>
      <textarea class="" rows="14" id="content" name="content">我宣你</textarea>  
     </div>
     <div style="display: none"  class="am-form-group">
      <label for="doc-ta-1" style="color: gray">学校ID：</label>
      <input class="" rows="14" value="10000" id="schoolId" name="schoolId">
     </div>
     
     <div class="am-form-group" >
      <label for="doc-ipt-email-1" style="color: gray">学校名称</label>
      <input type="text" class="" id="schoolName"  name="schoolName" >
    </div>
    </fieldset>
   
  
  
  



<div data-am-widget="gotop" class="am-gotop am-gotop-default" >
	<input type="submit" id="sub_butt" name="sub_butt" data-ajax="false" onclick="a()"  class="am-btn am-btn-primary am-btn-block"/>
</div>

 </from>


















</body>
</html>